package com.seocoo.worker.friend.adapter;

import android.text.TextUtils;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.seocoo.worker.R;
import com.seocoo.worker.base.ImageLoaderEngine;
import com.seocoo.worker.base.widget.BaseStarOrangeView;
import com.seocoo.worker.friend.rsp.RspFriendAppraise;

/**
 * author : Ssp
 * e-mail : 981297079@qq.com
 * date   : 2020/2/2320:32
 * desc   : 维修订单
 * version: 1.0
 */
public class FriendAppraiseAdapter extends BaseQuickAdapter<RspFriendAppraise, BaseViewHolder> {

    public FriendAppraiseAdapter() {
        super(R.layout.friend_appraise_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, RspFriendAppraise item) {
        BaseStarOrangeView baseStarOrangeView = helper.getView(R.id.bsovStar);
        baseStarOrangeView.setShowNoEnabledPosition(item.starCount);

        ImageView ivPhoto = helper.getView(R.id.civImg);
        if (TextUtils.isEmpty(item.avatar)) {
            ivPhoto.setImageResource(R.drawable.user_register);
        } else {
            new ImageLoaderEngine(item.avatar).error(R.drawable.user_register).placeholder(R.drawable.user_register).into(ivPhoto);
        }
        helper.setText(R.id.tv_name,item.nickName);
        helper.setText(R.id.tvTime,item.createdTime);
        helper.setText(R.id.tv_content,item.content);
    }
}
